3.6.2 \(\int \frac {1}{(a+b \sec (c+d x))^2} \, dx\) [502]

3.6.2.1 Optimal result
3.6.2.2 Mathematica [A] (verified)
3.6.2.3 Rubi [A] (verified)
3.6.2.4 Maple [A] (verified)
3.6.2.5 Fricas [B] (verification not implemented)
3.6.2.6 Sympy [F]
3.6.2.7 Maxima [F(-2)]
3.6.2.8 Giac [A] (verification not implemented)
3.6.2.9 Mupad [B] (verification not implemented)

3.6.2.1 Optimal result

Integrand size = 12, antiderivative size = 109 \[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=\frac {x}{a^2}-\frac {2 b \left (2 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 (a-b)^{3/2} (a+b)^{3/2} d}+\frac {b^2 \tan (c+d x)}{a \left (a^2-b^2\right ) d (a+b \sec (c+d x))} \]

output
x/a^2-2*b*(2*a^2-b^2)*arctanh((a-b)^(1/2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/ 
a^2/(a-b)^(3/2)/(a+b)^(3/2)/d+b^2*tan(d*x+c)/a/(a^2-b^2)/d/(a+b*sec(d*x+c) 
)
 
3.6.2.2 Mathematica [A] (verified)

Time = 0.38 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.27 \[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=\frac {-\frac {2 b \left (-2 a^2+b^2\right ) \text {arctanh}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+\frac {a \left (a^2-b^2\right ) (c+d x) \cos (c+d x)+b \left (\left (a^2-b^2\right ) (c+d x)+a b \sin (c+d x)\right )}{b+a \cos (c+d x)}}{a^2 (a-b) (a+b) d} \]

input
Integrate[(a + b*Sec[c + d*x])^(-2),x]
 
output
((-2*b*(-2*a^2 + b^2)*ArcTanh[((-a + b)*Tan[(c + d*x)/2])/Sqrt[a^2 - b^2]] 
)/Sqrt[a^2 - b^2] + (a*(a^2 - b^2)*(c + d*x)*Cos[c + d*x] + b*((a^2 - b^2) 
*(c + d*x) + a*b*Sin[c + d*x]))/(b + a*Cos[c + d*x]))/(a^2*(a - b)*(a + b) 
*d)
 
3.6.2.3 Rubi [A] (verified)

Time = 0.63 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.23, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {3042, 4272, 25, 3042, 4407, 3042, 4318, 3042, 3138, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {1}{(a+b \sec (c+d x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^2}dx\)

\(\Big \downarrow \) 4272

\(\displaystyle \frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}-\frac {\int -\frac {a^2-b \sec (c+d x) a-b^2}{a+b \sec (c+d x)}dx}{a \left (a^2-b^2\right )}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \frac {a^2-b \sec (c+d x) a-b^2}{a+b \sec (c+d x)}dx}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\int \frac {a^2-b \csc \left (c+d x+\frac {\pi }{2}\right ) a-b^2}{a+b \csc \left (c+d x+\frac {\pi }{2}\right )}dx}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 4407

\(\displaystyle \frac {\frac {x \left (a^2-b^2\right )}{a}-\frac {b \left (2 a^2-b^2\right ) \int \frac {\sec (c+d x)}{a+b \sec (c+d x)}dx}{a}}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {x \left (a^2-b^2\right )}{a}-\frac {b \left (2 a^2-b^2\right ) \int \frac {\csc \left (c+d x+\frac {\pi }{2}\right )}{a+b \csc \left (c+d x+\frac {\pi }{2}\right )}dx}{a}}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 4318

\(\displaystyle \frac {\frac {x \left (a^2-b^2\right )}{a}-\frac {\left (2 a^2-b^2\right ) \int \frac {1}{\frac {a \cos (c+d x)}{b}+1}dx}{a}}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\frac {x \left (a^2-b^2\right )}{a}-\frac {\left (2 a^2-b^2\right ) \int \frac {1}{\frac {a \sin \left (c+d x+\frac {\pi }{2}\right )}{b}+1}dx}{a}}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 3138

\(\displaystyle \frac {\frac {x \left (a^2-b^2\right )}{a}-\frac {2 \left (2 a^2-b^2\right ) \int \frac {1}{\left (1-\frac {a}{b}\right ) \tan ^2\left (\frac {1}{2} (c+d x)\right )+\frac {a+b}{b}}d\tan \left (\frac {1}{2} (c+d x)\right )}{a d}}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {\frac {x \left (a^2-b^2\right )}{a}-\frac {2 b \left (2 a^2-b^2\right ) \text {arctanh}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a d \sqrt {a-b} \sqrt {a+b}}}{a \left (a^2-b^2\right )}+\frac {b^2 \tan (c+d x)}{a d \left (a^2-b^2\right ) (a+b \sec (c+d x))}\)

input
Int[(a + b*Sec[c + d*x])^(-2),x]
 
output
(((a^2 - b^2)*x)/a - (2*b*(2*a^2 - b^2)*ArcTanh[(Sqrt[a - b]*Tan[(c + d*x) 
/2])/Sqrt[a + b]])/(a*Sqrt[a - b]*Sqrt[a + b]*d))/(a*(a^2 - b^2)) + (b^2*T 
an[c + d*x])/(a*(a^2 - b^2)*d*(a + b*Sec[c + d*x]))
 

3.6.2.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3138
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ 
e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d)   Subst[Int[1/(a + b + 
(a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] 
 && NeQ[a^2 - b^2, 0]
 

rule 4272
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[b^2*Cot[ 
c + d*x]*((a + b*Csc[c + d*x])^(n + 1)/(a*d*(n + 1)*(a^2 - b^2))), x] + Sim 
p[1/(a*(n + 1)*(a^2 - b^2))   Int[(a + b*Csc[c + d*x])^(n + 1)*Simp[(a^2 - 
b^2)*(n + 1) - a*b*(n + 1)*Csc[c + d*x] + b^2*(n + 2)*Csc[c + d*x]^2, x], x 
], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0] && LtQ[n, -1] && Integ 
erQ[2*n]
 

rule 4318
Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbo 
l] :> Simp[1/b   Int[1/(1 + (a/b)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, 
f}, x] && NeQ[a^2 - b^2, 0]
 

rule 4407
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
 (a_)), x_Symbol] :> Simp[c*(x/a), x] - Simp[(b*c - a*d)/a   Int[Csc[e + f* 
x]/(a + b*Csc[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c 
- a*d, 0]
 
3.6.2.4 Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.39

method result size
derivativedivides \(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}+\frac {2 b \left (-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b \right )}-\frac {\left (2 a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{2}}}{d}\) \(151\)
default \(\frac {\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{2}}+\frac {2 b \left (-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b -a -b \right )}-\frac {\left (2 a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{a^{2}}}{d}\) \(151\)
risch \(\frac {x}{a^{2}}+\frac {2 i b^{2} \left (b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}{a^{2} \left (a^{2}-b^{2}\right ) d \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}+\frac {2 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,a^{2}}-\frac {2 b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{\sqrt {a^{2}-b^{2}}\, a}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,a^{2}}\) \(407\)

input
int(1/(a+b*sec(d*x+c))^2,x,method=_RETURNVERBOSE)
 
output
1/d*(2/a^2*arctan(tan(1/2*d*x+1/2*c))+2*b/a^2*(-a*b/(a^2-b^2)*tan(1/2*d*x+ 
1/2*c)/(tan(1/2*d*x+1/2*c)^2*a-tan(1/2*d*x+1/2*c)^2*b-a-b)-(2*a^2-b^2)/(a- 
b)/(a+b)/((a-b)*(a+b))^(1/2)*arctanh((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b) 
)^(1/2))))
 
3.6.2.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 212 vs. \(2 (100) = 200\).

Time = 0.31 (sec) , antiderivative size = 484, normalized size of antiderivative = 4.44 \[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=\left [\frac {2 \, {\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d x \cos \left (d x + c\right ) + 2 \, {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d x + {\left (2 \, a^{2} b^{2} - b^{4} + {\left (2 \, a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) + 2 \, {\left (a^{3} b^{2} - a b^{4}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{7} - 2 \, a^{5} b^{2} + a^{3} b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b - 2 \, a^{4} b^{3} + a^{2} b^{5}\right )} d\right )}}, \frac {{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d x \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d x - {\left (2 \, a^{2} b^{2} - b^{4} + {\left (2 \, a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) + {\left (a^{3} b^{2} - a b^{4}\right )} \sin \left (d x + c\right )}{{\left (a^{7} - 2 \, a^{5} b^{2} + a^{3} b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{6} b - 2 \, a^{4} b^{3} + a^{2} b^{5}\right )} d}\right ] \]

input
integrate(1/(a+b*sec(d*x+c))^2,x, algorithm="fricas")
 
output
[1/2*(2*(a^5 - 2*a^3*b^2 + a*b^4)*d*x*cos(d*x + c) + 2*(a^4*b - 2*a^2*b^3 
+ b^5)*d*x + (2*a^2*b^2 - b^4 + (2*a^3*b - a*b^3)*cos(d*x + c))*sqrt(a^2 - 
 b^2)*log((2*a*b*cos(d*x + c) - (a^2 - 2*b^2)*cos(d*x + c)^2 - 2*sqrt(a^2 
- b^2)*(b*cos(d*x + c) + a)*sin(d*x + c) + 2*a^2 - b^2)/(a^2*cos(d*x + c)^ 
2 + 2*a*b*cos(d*x + c) + b^2)) + 2*(a^3*b^2 - a*b^4)*sin(d*x + c))/((a^7 - 
 2*a^5*b^2 + a^3*b^4)*d*cos(d*x + c) + (a^6*b - 2*a^4*b^3 + a^2*b^5)*d), ( 
(a^5 - 2*a^3*b^2 + a*b^4)*d*x*cos(d*x + c) + (a^4*b - 2*a^2*b^3 + b^5)*d*x 
 - (2*a^2*b^2 - b^4 + (2*a^3*b - a*b^3)*cos(d*x + c))*sqrt(-a^2 + b^2)*arc 
tan(-sqrt(-a^2 + b^2)*(b*cos(d*x + c) + a)/((a^2 - b^2)*sin(d*x + c))) + ( 
a^3*b^2 - a*b^4)*sin(d*x + c))/((a^7 - 2*a^5*b^2 + a^3*b^4)*d*cos(d*x + c) 
 + (a^6*b - 2*a^4*b^3 + a^2*b^5)*d)]
 
3.6.2.6 Sympy [F]

\[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=\int \frac {1}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \]

input
integrate(1/(a+b*sec(d*x+c))**2,x)
 
output
Integral((a + b*sec(c + d*x))**(-2), x)
 
3.6.2.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]

input
integrate(1/(a+b*sec(d*x+c))^2,x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f 
or more de
 
3.6.2.8 Giac [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.64 \[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=-\frac {\frac {2 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a^{3} - a b^{2}\right )} {\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )}} + \frac {2 \, {\left (2 \, a^{2} b - b^{3}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )}}{{\left (a^{4} - a^{2} b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {d x + c}{a^{2}}}{d} \]

input
integrate(1/(a+b*sec(d*x+c))^2,x, algorithm="giac")
 
output
-(2*b^2*tan(1/2*d*x + 1/2*c)/((a^3 - a*b^2)*(a*tan(1/2*d*x + 1/2*c)^2 - b* 
tan(1/2*d*x + 1/2*c)^2 - a - b)) + 2*(2*a^2*b - b^3)*(pi*floor(1/2*(d*x + 
c)/pi + 1/2)*sgn(-2*a + 2*b) + arctan(-(a*tan(1/2*d*x + 1/2*c) - b*tan(1/2 
*d*x + 1/2*c))/sqrt(-a^2 + b^2)))/((a^4 - a^2*b^2)*sqrt(-a^2 + b^2)) - (d* 
x + c)/a^2)/d
 
3.6.2.9 Mupad [B] (verification not implemented)

Time = 19.12 (sec) , antiderivative size = 2886, normalized size of antiderivative = 26.48 \[ \int \frac {1}{(a+b \sec (c+d x))^2} \, dx=\text {Too large to display} \]

input
int(1/(a + b/cos(c + d*x))^2,x)
 
output
(2*atan((((((32*(2*a^8*b - a^9 + a^4*b^5 - 3*a^6*b^3 + a^7*b^2))/(a^5*b + 
a^6 - a^3*b^3 - a^4*b^2) - (tan(c/2 + (d*x)/2)*(2*a^9*b - 2*a^4*b^6 + 2*a^ 
5*b^5 + 4*a^6*b^4 - 4*a^7*b^3 - 2*a^8*b^2)*32i)/(a^2*(a^4*b + a^5 - a^2*b^ 
3 - a^3*b^2)))*1i)/a^2 + (32*tan(c/2 + (d*x)/2)*(a^6 - 2*a^5*b - 2*a*b^5 + 
 2*b^6 - 5*a^2*b^4 + 4*a^3*b^3 + 3*a^4*b^2))/(a^4*b + a^5 - a^2*b^3 - a^3* 
b^2))/a^2 - ((((32*(2*a^8*b - a^9 + a^4*b^5 - 3*a^6*b^3 + a^7*b^2))/(a^5*b 
 + a^6 - a^3*b^3 - a^4*b^2) + (tan(c/2 + (d*x)/2)*(2*a^9*b - 2*a^4*b^6 + 2 
*a^5*b^5 + 4*a^6*b^4 - 4*a^7*b^3 - 2*a^8*b^2)*32i)/(a^2*(a^4*b + a^5 - a^2 
*b^3 - a^3*b^2)))*1i)/a^2 - (32*tan(c/2 + (d*x)/2)*(a^6 - 2*a^5*b - 2*a*b^ 
5 + 2*b^6 - 5*a^2*b^4 + 4*a^3*b^3 + 3*a^4*b^2))/(a^4*b + a^5 - a^2*b^3 - a 
^3*b^2))/a^2)/((64*(2*a^4*b - a*b^4 + b^5 - 3*a^2*b^3 + 2*a^3*b^2))/(a^5*b 
 + a^6 - a^3*b^3 - a^4*b^2) + (((((32*(2*a^8*b - a^9 + a^4*b^5 - 3*a^6*b^3 
 + a^7*b^2))/(a^5*b + a^6 - a^3*b^3 - a^4*b^2) - (tan(c/2 + (d*x)/2)*(2*a^ 
9*b - 2*a^4*b^6 + 2*a^5*b^5 + 4*a^6*b^4 - 4*a^7*b^3 - 2*a^8*b^2)*32i)/(a^2 
*(a^4*b + a^5 - a^2*b^3 - a^3*b^2)))*1i)/a^2 + (32*tan(c/2 + (d*x)/2)*(a^6 
 - 2*a^5*b - 2*a*b^5 + 2*b^6 - 5*a^2*b^4 + 4*a^3*b^3 + 3*a^4*b^2))/(a^4*b 
+ a^5 - a^2*b^3 - a^3*b^2))*1i)/a^2 + (((((32*(2*a^8*b - a^9 + a^4*b^5 - 3 
*a^6*b^3 + a^7*b^2))/(a^5*b + a^6 - a^3*b^3 - a^4*b^2) + (tan(c/2 + (d*x)/ 
2)*(2*a^9*b - 2*a^4*b^6 + 2*a^5*b^5 + 4*a^6*b^4 - 4*a^7*b^3 - 2*a^8*b^2)*3 
2i)/(a^2*(a^4*b + a^5 - a^2*b^3 - a^3*b^2)))*1i)/a^2 - (32*tan(c/2 + (d...